package com.org.gsc.menusdemo;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
/**
 * Created by qundui on 2017/6/26.
 */

public class ListPage extends ListActivity {
    private String[] madatas={"menudrawer","SlidingMenu","DrawerLayoutDemo"};
    Class classz []={MainActivity.class,SlidingMenuDemo.class,DrawerLayoutDemo.class};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getListView().setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,android.R.id.text1,madatas));
         getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
             @Override
             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                 startActivity(new Intent(ListPage.this,classz[position]));

             }
         });
    }
}
